package cn.zsb.zsb.vo;

//import io.swagger.annotations.ApiModel;
//import io.swagger.annotations.ApiModelProperty;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

/**
 * @author oldliu
 * @since 1.0
 */
//分页准备
//@ApiModel("分页类")
public class Page<T> implements Serializable {
    //@ApiModelProperty("状态码，0表示成功")
    private int code=0;//是否成功，0表示成功
    //@ApiModelProperty("信息提示")
    private String msg="成功";//操作信息
    //@ApiModelProperty("查询总数")
    private long count;//总数
    //@ApiModelProperty("当前页码")
    private int page;//页号
    //@ApiModelProperty("查询页大小")
    private int limit=10;//页大小
    //@ApiModelProperty("查询的结果集合")
    private List<T> data = new ArrayList<>();//本页数据

    public Page(){

    }

    public Page(long count, List<T> data) {
        this.count = count;
        this.data = data;
    }

    public Page(long count, int page, int limit, List<T> data) {
        this.count = count;
        this.page = page;
        this.limit = limit;
        this.data = data;
    }

    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public int getPage() {
        return page;
    }

    public void setPage(int page) {
        this.page = page;
    }

    public int getLimit() {
        return limit;
    }

    public void setLimit(int limit) {
        this.limit = limit;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    public long getCount() {
        return count;
    }

    public void setCount(long count) {
        this.count = count;
    }

    public List<T> getData() {
        return data;
    }

    public void setData(List<T> data) {
        this.data = data;
    }

    @Override
    public String toString() {
        return "Page{" +
                "code=" + code +
                ", msg='" + msg + '\'' +
                ", count=" + count +
                ", page=" + page +
                ", limit=" + limit +
                ", data=" + data +
                '}';
    }
}
